package com.wit.zhenghao.day11;

import org.junit.Test;

public class DemoRegex {

	@Test
	public void test() {
		String regex = ".*abc";
		System.out.println("abc".matches(regex));
		System.out.println("1abc".matches(regex));
		System.out.println("abcd".matches(regex));	
	}
	
	@Test
	public void test2() {
		String regex = ".+123$";
		System.out.println("123".matches(regex));
		System.out.println("a123".matches(regex));
		System.out.println("a1234".matches(regex));	
	}
	
	@Test
	public void test3() {
		String regex = "(?=^[a-zA-Z]).{6,18}";
		System.out.println("abc".matches(regex));
		System.out.println("abcdef".matches(regex));
		System.out.println("zhenghao1997".matches(regex));	
		System.out.println("12345Abc".matches(regex));	
	}
	
}
